﻿using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Diagnostics;
using BlockMain_Class;

namespace LevelDBDemo
{
    class Program
    {
        public static Stopwatch st = new Stopwatch();
        static void Main(string[] args)
        {

           // ThreadPool.SetMaxThreads(9, 9);
            st.Start();
            //for (int i = 0; i < 10000; i++)
            //{
                WriteTest1(1);
                //ThreadPool.QueueUserWorkItem(WriteTest1, 1);
            //}
            Console.WriteLine(st.ElapsedMilliseconds.ToString());
            Console.ReadKey();
        }

        public static void WriteTest1(object a)
        {

            PeerList class1 = new PeerList();
            MongodbHelpers<PeerList> mon = new MongodbHelpers<PeerList>();
            class1.PeerIp = "127.0.0.1";
            class1.Port = 4000;
            class1.Account = "Peer4";
            class1.Password = "123456";
            class1.Detail = "检测节点4，具有完善的检测经验及有效的证书颁发机构";
            var result = mon.Insert(class1);
            Console.WriteLine(st.ElapsedMilliseconds.ToString());
        }
    
    }
}